<%@ page language="java" contentType="text/html; charset=UTF8" pageEncoding="UTF8"
         import="es.ats.codington.festival.domain.Event" 
         import="java.util.ArrayList"%>
<html>
	<head>
		<jsp:include page="wireframe.jsp"/>
        <link rel="stylesheet" type="text/css" href="./css/admin.css" />
	</head>
	<body>
		<jsp:include page="navbar.jsp"/>
		<div class="container">
		    <div class="row">
		    	<div class="col-lg-1" style="margin-top:80px;">
		    		<a href="pnewevent" class="table-link">
                    	<button class="btn btn-success" type="submit"><span class="glyphicon glyphicon-plus"></span></button>
					</a>
		    	</div>
		        <div class="col-lg-11">		
		            <div class="main-box no-header clearfix">
		                <div class="main-box-body clearfix">
		                    <div class="table-responsive">
		                        <table class="table user-list">
		                            <thead>
		                                <tr>
		                                <th class="text-center"><span>Event</span></th>
		                                <th class="text-center"><span>Date</span></th>
		                                <th class="text-center" style="width:150px"><span>Status</span></th>
		                                <th>&nbsp;</th>
		                                <th>&nbsp;</th>
		                                <th>&nbsp;</th>
		                                </tr>
		                            </thead>
		                            <tbody>
		                            <%int lsize=(Integer) request.getAttribute("eventsize");%>
						            <%ArrayList<Event> events = new ArrayList<Event>();%>
						            <%events=(ArrayList<Event>) request.getAttribute("allevents");%>
						            <%for (int i=0;i<lsize;i++){%>
		                                <tr>
		                                    <td>
		                                        <b><%=events.get(i).getName()%></b>
		                                    </td>
		                                    <td><%=events.get(i).getStart()%></td>
		                                    <td>
		                                        <div class="progress">
												  <div class="progress-bar" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="min-width: 2em; width: 2%;">
												    2%
												  </div>
												</div>
		                                    </td>
		                                    <td>
		                                    	<a href="event?eventid=<%=events.get(i).getEventId()%>" class="table-link">
		                                            <button class="btn btn-success" type="submit"><span class="glyphicon glyphicon-eye-open"></span></button>
												</a>
												<a href="pupdateevent?eventid=<%=events.get(i).getEventId()%>" class="table-link">
		                                            <button class="btn btn-success" disabled="disabled" type="submit"><span class="glyphicon glyphicon-pencil"></span></button>
												</a>
												<a href="deleteevent?eventid=<%=events.get(i).getEventId()%>" class="table-link">
		                                            <button class="btn btn-danger" type="submit"><span class="glyphicon glyphicon-trash"></span></button>
												</a>
		                                    </td>
		                                </tr>
		                            <%}%>
		                            </tbody>
		                        </table>
		                    </div>
		                </div>
		            </div>
		        </div>
		    </div>		    
		</div>
	</body>
</html>